package cn.wolfcode.domain;

import cn.wolfcode.Enum.LevelEnum;
import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;

@Data
public class Notice {
    /** */
    private Long id;

    /** */
    private String title;

    /** */
    private Employee employee;

    /** */
    private Date creattime;

    /** */
    private Integer level;

    /** */
    private Boolean readstatus;

    /** */
    private Boolean releasestatus;

    /** */
    private String textArea;

    public String toJson(){
        HashMap<String, Object> map = new HashMap<>();
            map.put("id",id);
            map.put("title",title);
            map.put("textArea",textArea);
            map.put("level",level);
            return JSON.toJSONString(map);
    }


    public String getNoticeLevelName(){
        return LevelEnum.findName(level);
    }

}